package com.design.demo2;
/**
 * 功能键类:请求发送者
 * @author wdd_think
 *
 */
public class FunctionButton{
	private String name;//功能键名称
	private Command command;//维持一个抽象命令对象的引用
	
	public FunctionButton(String name) {
		super();
		this.name = name;
	}

	public String getName() {
		return name;
	}
	//为功能键注于命令
	public void setCommand(Command command) {
		this.command = command;
	}
	//发送请求的方法
	public void onClick(){
		System.out.print(name +"点击功能键:");
		command.execute();
	}
}
